x86/hvm: add per-vcpu evtchn upcalls
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 19 Jan 2015 11:18:03 +0000 (12:18 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Jan 2015 11:18:03 +0000 (12:18 +0100)
commit04447f4453c008b36c3e3443f0fc44e66ddd821d
treea1eac5d1ac38f7df8d47ce7cfbe4e6fc0b7e83e1
parent2eddc5d2dc18dfc161de7cd578a4be0d3479d9af
x86/hvm: add per-vcpu evtchn upcalls

HVM guests have always been confined to using the domain callback
via (see HVM_PARAM_CALLBACK_IRQ) to receive event notifications.
This is usually an IOAPIC vector and is only used if the event
channel is bound to vcpu 0.

PVHVM Linux uses a pre-defined interrupt vector for the event
channel upcall, set using HVM_PARAM_CALLBACK_IRQ by ORing in a
special bit (bit 57) into the value (see params.h). However, it
does not assert the interrupt via the emulated local APIC.

This mechanism is not suitable in the general case since Windows
(and potentially other OSes) because they:

- cannot guarantee the same vector for all VCPUs
- do require the upcall to be asserted via the local APIC

This patch adds a new HVM op allowing a guest to specify a local
APIC vector to use as an upcall notification for a specific vcpu
therefore coping with the case of differing vector numbers.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/irq.c
xen/include/asm-x86/hvm/vcpu.h
xen/include/public/hvm/hvm_op.h